<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script type="text/javascript" src="../js/vue.js"></script>
</head>
<style>
</style>
<body>
<!-- 容器 -->
<div id="root">
</div>
<script type="text/javascript">
    Vue.config.productionTip = false //阻止 vue 在启动时生成生产提示。
    // 定义组件
    const hello=Vue.extend({
        template:`
        <div>
            <h1>{{name}}</h1>
</div>`,
        data(){
            return{
                name:'hello everyone',
            }
        }
    })
    const school=Vue.extend({
        template:`
        <div>
            <h1>{{name}}</h1>
            <p>{{address}}</p>
        </div>
    `,
        data(){
            return{
                name:'中英文学校',
                address:'河南省',
            }
        }
    })
    const student=Vue.extend({
        template:`
        <div>
          <h1>{{name}}</h1>
          <p>{{age}}</p>
          <school></school>
        </div>
    `,
        data(){
            return{
                name:'张三',
                age:20,
            }
        },
        components:{
            school
        }
    })
    const app=Vue.extend({
        template:`
          <div>
            <hello></hello>
            <student></student>
          </div>`,
        components:{
            hello,
            student
        },
    })
    new Vue({
        template:`
            <app></app>`,
        el:'#root',
        components:{app}
    })
</script>
</body>
</html>